import tkinter as tk
from tkinter import ttk

from views import Roster, Attendance, Salary


class MainPage(ttk.Frame):
    def __init__(self, parent, controller):
        super().__init__(parent)
        label = ttk.Label(self, text="主页面")
        label.pack(pady=10, padx=10)
        # 延迟导入
        from views.Roster import Roster
        from views.Attendance import Attendance
        from views.Salary import Salary

        button1 = ttk.Button(self, text="花名册",
                             command=lambda: controller.show_frame(Roster))
        button1.pack()

        button2 = ttk.Button(self, text="考勤",
                             command=lambda: controller.show_frame(Attendance))
        button2.pack()

        button3 = ttk.Button(self, text="工资",
                             command=lambda: controller.show_frame(Salary))
        button3.pack()
